fix: dedupe number_of_cores in Drawer for from_dict round-trip#1270
Merged
Conversation
Drawer.__init__ hardcoded `number_of_cores=1` while also forwarding `**kwargs` to super(). A round-tripped Drawer.search.json carries `number_of_cores` at the top level (the resolved value), so `from_dict(saved_dict)` crashed with: TypeError: AbstractMLE.__init__() got multiple values for keyword argument 'number_of_cores' Pop `number_of_cores` from kwargs before forwarding. Drawer is single-core only by design, so the saved value is always 1 and discarding it is safe. Surfaced by the autogalaxy_workspace `scripts/ellipse/database.py` example, which scrapes Drawer fits via the aggregator. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 15, 2026
Collaborator
Author
|
Workspace PR: PyAutoLabs/autogalaxy_workspace#73 |
2 tasks
Collaborator
Author
|
Workspace PR (PyAutoBuild config): PyAutoLabs/PyAutoBuild#89 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix a
TypeErrorinDrawer.__init__when a saved Drawer search is reconstructed viaautoconf.dictable.from_dict. The constructor hardcodednumber_of_cores=1in itssuper().__init__(...)call while also forwarding**kwargs; the savedsearch.jsonof a Drawer fit carriesnumber_of_coresat the top level (the resolved value, always1), which collided.The fix pops
number_of_coresfromkwargsbefore forwarding tosuper(). Drawer is single-core only by design, so the saved value is always1and discarding it is safe.Surfaced by the
autogalaxy_workspace/scripts/ellipse/database.pyaggregator example (unparked in the companion workspace PR). Before this fix, scraping any output directory containing a Drawer fit raised:API Changes
None — internal bugfix only.
Test Plan
test__dict_round_trip_with_number_of_coresintest_autofit/non_linear/search/optimize/test_drawer.pyround-trips aDrawerthroughto_dict/from_dictand asserts the resolvednumber_of_cores == 1.autogalaxy_workspace/scripts/ellipse/database.pynow completes underPYAUTO_TEST_MODE=2, including the aggregator scrape of thefit_allDrawer outputs (was previously the failure point).Full API Changes (for automation & release notes)
Removed
Added
Renamed
Changed Signature
Changed Behaviour
autofit.Drawer.__init__— popsnumber_of_coresfrom**kwargsbefore forwarding toAbstractMLE.__init__. No effect on direct construction (users have never been able to override Drawer's single-core operation); only fixes the previously-brokenfrom_dictround-trip.Migration
None required — pure bugfix.
🤖 Generated with Claude Code